package com.yang.system.domain.orgMng.emp;

public enum EmpStatus {
    PROBATION("试用期", 1),
    REGULAR("正式", 2),
    TERMINATED("离职", 3);
    private final String description; // 描述
    private final int code; // 状态码
    EmpStatus(String description, int code) {
        this.description = description;
        this.code = code;
    }
    // 获取描述
    public String getDescription() {
        return description;
    }

    // 获取状态码
    public int getCode() {
        return code;
    }

    // 根据状态码获取枚举实例
    public static EmpStatus getByCode(int code) {
        return EmpStatus.getByCode(code);
    }

    @Override
    public String toString() {
        return this.description;
    }
}
